package demo1;

public class Test {

    public static void animalBark(Animal animal) {
        animal.bark();
    }

    public static void main(String[] args) {
        Animal cat = new Cat();
        Animal dog = new Dog();
        animalBark(dog);
        animalBark(cat);
    }
}

interface Animal {
//    int A = 1;
//    public int B = 1;
//    public static final int C = 1;
//    public final int D = 1;

    void bark();
//    public static void bark2() {
//
//    }
}

class Dog implements Animal {
    @Override
    public void bark() {
        System.out.println("狗叫");
    }
}

class Cat implements Animal {
    @Override
    public void bark() {
        System.out.println("猫叫");
    }
}